/**
  ******************************************************************************
  * @file    stm32f4xx.h
  * @author  MCD Application Team
  * @brief   CMSIS STM32F4xx Device Peripheral Access Layer Header File.
  *
  *          The file is the unique include file that the application programmer
  *          is using in the C source code, usually in main.c. This file contains:
  *           - Configuration section that allows to configure:
  *              - The system clock
  *              - Systick time unit
  *              - HSE, HSI and LSE oscillators
  *              - FLASH latency
  *           - Data structures and the address mapping for all peripherals.
  *           - peripherals devices pointers to the register structures and
  *              bitfields definitions.
  *           - System Configuration.
  *           - Debug Configuration.
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_H
#define __STM32F4xx_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_types.h"
#include "system_stm32f4xx.h"
#include <stdint.h>

/** @addtogroup STM32F4xx_StdPeriph_Driver
  * @{
  */

/** @addtogroup Configuration_exported_structures
  * @{
  */

/* Exported types ------------------------------------------------------------*/

/* Exported constants --------------------------------------------------------*/

/* ########################## HSE/HSI Values adaptation ##################### */
/**
  * @brief Default value of the External oscillator in Hz.
  *        This value can be provided and adapted by the user application in the compiler driver options,
  *        or in the associated preprocessor.
  */
#if !defined  (HSE_VALUE) 
  #define HSE_VALUE    ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz.
                                                This value can be provided and adapted by the user application in the compiler driver options,
                                                or in the associated preprocessor. */
#endif /* HSE_VALUE */

#if !defined  (HSE_STARTUP_TIMEOUT)
  #define HSE_STARTUP_TIMEOUT    ((uint32_t)5000)   /*!< Time out for HSE start up, in ms */
#endif /* HSE_STARTUP_TIMEOUT */

/**
  * @brief Default value of the Internal High Speed oscillator (HSI) in Hz.
  *        This value can be provided and adapted by the user application in the compiler driver options,
  *        or in the associated preprocessor.
  */
#if !defined  (HSI_VALUE)
  #define HSI_VALUE    ((uint32_t)16000000) /*!< Default value of the Internal High Speed oscillator in Hz.
                                                This value can be provided and adapted by the user application in the compiler driver options,
                                                or in the associated preprocessor. */
#endif /* HSI_VALUE */

/**
  * @brief Default value of the External Low Speed oscillator (LSE) in Hz.
  *        This value can be provided and adapted by the user application in the compiler driver options,
  *        or in the associated preprocessor.
  */
#if !defined  (LSE_VALUE)
  #define LSE_VALUE    ((uint32_t)32768)    /*!< Default value of the External Low Speed oscillator in Hz.
                                                This value can be provided and adapted by the user application in the compiler driver options,
                                                or in the associated preprocessor. */
#endif /* LSE_VALUE */

#if !defined  (LSE_STARTUP_TIMEOUT)
  #define LSE_STARTUP_TIMEOUT    ((uint32_t)5000)   /*!< Time out for LSE start up, in ms */
#endif /* LSE_STARTUP_TIMEOUT */

/* Tip: To avoid modifying this file each time you need to use different HSE,
   ===  you can define the HSE value in your toolchain compiler preprocessor. */

/* ########################### System Configuration ######################### */
/**
  * @brief This is the HAL system configuration section
  */     
#define  VDD_VALUE                    ((uint32_t)3300) /*!< Value of VDD in mv */
#define  TICK_INT_PRIORITY            ((uint32_t)0)    /*!< tick interrupt priority */
#define  USE_RTOS                     0
#define  PREFETCH_ENABLE              1
#define  INSTRUCTION_CACHE_ENABLE     1
#define  DATA_CACHE_ENABLE            1

/* ########################## Assert Selection ############################## */
/**
  * @brief Uncomment the line below to expanse the "assert_param" macro in the 
  *        HAL drivers code
  */
/* #define USE_FULL_ASSERT    1 */

/* Includes ------------------------------------------------------------------*/
/**
  * @brief Include module's header file 
  */

#ifdef HAL_RCC_MODULE_ENABLED
 #include "stm32f4xx_hal_rcc.h"
#endif /* HAL_RCC_MODULE_ENABLED */

#ifdef HAL_GPIO_MODULE_ENABLED
 #include "stm32f4xx_hal_gpio.h"
#endif /* HAL_GPIO_MODULE_ENABLED */

#ifdef HAL_SPI_MODULE_ENABLED
 #include "stm32f4xx_hal_spi.h"
#endif /* HAL_SPI_MODULE_ENABLED */

/* Exported macro ------------------------------------------------------------*/
#ifdef  USE_FULL_ASSERT
/**
  * @brief  The assert_param macro is used for function's parameters check.
  * @param  expr: If expr is false, it calls assert_failed function
  *         which reports the name of the source file and the source
  *         line number of the call that failed. 
  *         If expr is true, it returns no value.
  * @retval None
  */
  #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
  void assert_failed(uint8_t* file, uint32_t line);
#else
  #define assert_param(expr) ((void)0)
#endif /* USE_FULL_ASSERT */

#ifdef __cplusplus
}
#endif

#endif /* __STM32F4xx_H */

/**
  * @}
  */

/**
  * @}
  */
